package lab02.test18;

/**
 * Created by ASUS on 2017/10/26.
 */
public class Test01 {

    public static void main(String[] args) {

        //char 字符：a，b，c....
        String name = "My name is Network crazy";

        System.out.println(name.length());

        System.out.println("字符串第一个字符：" + name.charAt(0));

        System.out.println("字符串最后一个字符：" + name.charAt(name.length() - 1));

        String[] result = name.split(" ");
        System.out.println("打印字符串的第一个单词：" + result[0]);

        //打印字符串crazy的位置（从0开始编号的位置）
        System.out.println("crazy的位置：" + name.indexOf("crazy"));
    }
}
